<?php

class Web_Svc_Delivery
{

    public function doIt()
    {
        $this->enviarDelivery();
    }

    private function enviarDelivery()
    {
        if ($_GET['cant']) {
            $data['promo'] = $_GET['cant'];
            $data['total'] = $_SESSION['subtotal'] + $_GET['cant'];

            $_SESSION['idDelivery'] = $_GET['id'];
            $_SESSION['precioDelivery'] = $_GET['cant'];
        }

        header('Content-type: application/json');
        
        echo json_encode($data);
    }

}